/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.bkav.portal.porlet.service.impl;

import java.util.Date;


import com.bkav.portal.porlet.model.Userlogs;
import com.bkav.portal.porlet.service.base.UserlogsLocalServiceBaseImpl;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;

/**
 * The implementation of the userlogs local service.
 *
 * <p>
 * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link com.bkav.portal.porlet.service.UserlogsLocalService} interface.
 *
 * <p>
 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
 * </p>
 *
 * @author namlh
 * @see com.bkav.portal.porlet.service.base.UserlogsLocalServiceBaseImpl
 * @see com.bkav.portal.porlet.service.UserlogsLocalServiceUtil
 */
public class UserlogsLocalServiceImpl extends UserlogsLocalServiceBaseImpl {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never reference this interface directly. Always use {@link com.bkav.portal.porlet.service.UserlogsLocalServiceUtil} to access the userlogs local service.
	 */

	public Userlogs addUserlogs(long companyId, long groupId, long userId,
			String userName, String userlogsName , String userlogsAction) throws SystemException,
			PortalException {

		Date now = new Date();

		long userlogsId = counterLocalService.increment();

		Userlogs userlogs = userlogsPersistence.create(userlogsId);

		userlogs.setCompanyId(companyId);
		userlogs.setGroupId(groupId);
		userlogs.setUserId(userId);
		userlogs.setUserName(userName);
		userlogs.setUserlogsId(userlogsId);
		userlogs.setUserlogsName(userlogsName);
		userlogs.setUserlogsAction(userlogsAction);
		userlogs.setCreateDate(now);
		userlogs.setModifiedDate(now);

		userlogsPersistence.update(userlogs, false);
	
		return userlogs;

	}
	
}